Dew Signal for .NET
|
Fast envelope detector.
A simple and fast envelope detector using moving average filter. FrameSize defines the length of the moving average (low pass filter) and the downsampling factor. The result is placed in Dst. Dst.Length = Src.Length div FrameSize. Src.Length must be divisable by FrameSize. This routine is 10 to 100x times faster then a decimator based envelope detector. Its drawback is higher noise due to some aliasing. Envelope detection is used to find the frequency of events with "long" periods.
For example: sampling frequency is 11kHz. The audio card is recording hammer impacts which occur once every five seconds. Because the duration of the hammer impact is very short, the 0.2 Hz frequency will not show up in the frequency spectrum of the signal, regardless of the frequency resolution, especially because the audio card filters out everything below 20 Hz. By selecting FrameSize = 2000 the sampling frequency will be reduced by 2000x, by averaging together groups of rectified samples. The frequency spectrum of the filtered signal will show a clear peak at 0.2 Hz.
A simple test of the function:
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
|
What do you think about this topic? Send feedback!
|